package com.zrrd.learn.exam;

import java.util.Arrays;

/**
 * @author wrn
 * @version 1.0
 * @date 2023/8/31 13:29
 */

public class test20230831_01 {

    /**
     * 1.统计十个同学的最高分，最低分以及平均分（分数：77.1, 88.1, 76.1, 56.1, 87.1, 98.1, 55.1, 94.1, 39.1, 96.1）。
     * @param args
     */
    public static void main(String[] args) {

        double [] score = {77.1, 88.1, 76.1, 56.1, 87.1, 98.1, 55.1, 94.1, 39.1, 96.1};
        double max=score[0];
        double min=score[0];
        double sum=0;
        double avg=0;

        for (int i = 0; i < score.length; i++) {
            if (max<score[i]) {
                max = score[i];
            }
            if (min>score[i]) {
                min = score[i];
            }
        }
        for (int i = 0; i < score.length; i++) {
            sum += score[i];
        }
        avg = sum/ score.length;
        System.out.println("最高分"+max);
        System.out.println("最低分"+min);
        System.out.println("平均分"+avg);


    }
}
